<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			console.log('ssda');
			let that = this
			if(!args) return;
			var args = plus.runtime.arguments;
			console.log(args, 'args');
			const queryString = args.split('?')[1];

			// 将查询字符串拆分为键值对数组
			const paramsArray = queryString.split('&');
			const params = {};

			// 遍历键值对数组，构建参数对象
			paramsArray.forEach(param => {
				const [key, value] = param.split('=');
				if (key && value) {
					params[key] = decodeURIComponent(value);
				}
			});
			// 访问特定参数值
			const phantomEncryptionPublicKey = params['phantom_encryption_public_key'];

			const nonce = params['nonce'];
			const data = params['data'];
			if(phantomEncryptionPublicKey){
				console.log(phantomEncryptionPublicKey, 'phantomEncryptionPublicKey');
				uni.setStorageSync('phantomEncryptionPublicKey', phantomEncryptionPublicKey)
			}

			if (nonce && data && phantomEncryptionPublicKey) {
				console.log('解密里连接返回');
				uni.setStorageSync('nonce', nonce)
				uni.setStorageSync('data', data)
			}
			if(nonce && data && phantomEncryptionPublicKey ==undefined){
				console.log('解密签名返回');
				uni.setStorageSync('nonce', nonce)
				uni.setStorageSync('data', data)
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>